<template>
	<view class="page">
	  <view class="pd_lf--40">
<!--	    <image src="/static/images/row-bg.png" class="img_all_bg" />-->
	    <view class="page_title">总禁食时间</view>
	    <view class="page_time">{{ hour }}<text>小时</text>{{ min }}<text>分钟</text></view>
	    <view class="card_wrap">
	      <view class="card_title">感受如何？</view>
	      <view class="card_express">
	        <block v-for="(item,index) in express" >
	          <view :class="{'express_item':true,'select': select === index}"  @click="chooseExpress(index)">
	            <image class="express_icon" :src="item.icon" />
	            <view class="express_text">{{item.title}}</view>
	          </view>
	        </block>
	      </view>
	      <view class="card_text">
	        <view class="text_title">记录</view>
	        <view class="text_wrap">
	          <textarea placeholder="添加备注"  v-model="content" ></textarea>
	        </view>
	      </view>
	    </view>
	    <view class="page_btn">
	      <view class="btn_delete" @click="deleteComment">删除</view>
	      <view class="btn_save" @click="save">保存</view>
	    </view>
	    <view class="empty_space"></view>
	  </view>
	</view>
</template>

<script>
const app = getApp();
import colors from '@/mixins/color';
export default {
  data(){
    return{
      express: [
        {
          title: '有点难',
          icon: './static/timer_icon_10.png',
          level: 1,
        },
        {
          title: '刚刚好',
          icon: './static/timer_icon_11.png',
          level: 3,
        },
        {
          title: '简单',
          icon: './static/timer_icon_12.png',
          level: 5,
        },
      ],
      select: 1,
      content: '',
      hour: '',
      min: '',
    }
  },
  mixins:[colors],
  onLoad(options) {
    const {hour, min} = options
    this.hour = hour
    this.min = min

  },
  onUnload() {
    console.log('onUnload')
    uni.$emit('refresh');
  },
  methods:{
    chooseExpress(e){
      this.select = e
    },
    deleteComment(){

    },
    save(){

    }
  }
}
</script>

<style lang="scss" scoped>
page {
  background: #ffffff;
}
.img_bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 325rpx;
  z-index: -1;
}
.pd_lf--40 {
  padding: 0 40rpx;
  box-sizing: border-box;
}
.page_title {
  font-size: 28rpx;
  color: #ffffff;
  line-height: 1;
  text-align: center;
}
.page_time {
  margin-top: 20rpx;
  font-size: 46rpx;
  line-height: 1;
  color: #ffffff;
  text-align: center;
}
.page_time text {
  font-size: 26rpx;
}
.card_wrap {
  margin-top: 48rpx;
  width: 100%;
  border-radius: 24rpx;
  background: #ffffff;
  box-shadow: 0px 1px 46px 0px rgba(136, 142, 163, 0.33);
  padding: 64rpx 0 34rpx;
}
.card_express {
  margin-top: 60rpx;
  display: flex;
}
.card_title {
  color: #384CA2;
  font-weight: 600;
  line-height: 1;
  font-size: 32rpx;
  text-align: center;
}
.express_item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: .3;
}
.express_item.select {
  opacity: 1;
}
.express_icon {
  width: 83rpx;
  height: 106rpx;
  display: block;
}
.express_text {
  margin-top: 30rpx;
  color: #5C647C;
  font-size: 32rpx;
  font-weight: 600;
  line-height: 1;
}
.card_text {
  margin-top: 124rpx;
}
.text_title {
  color: #5C647C;
  font-size: 32rpx;
  font-weight: bold;
  line-height: 1;
  text-align: center;
}
.text_wrap {
  margin-top: 32rpx;
}
.text_wrap textarea {
  border-radius: 24rpx;
  background: #EFF3FD;
  padding: 32rpx;
  box-sizing: border-box;
  margin: 0 auto;
  font-size: 30rpx;
  color: #333333;
}
.textarea-placeholder {
  color: #B0B6C5;
}
.page_btn {
  margin-top: 186rpx;
  display: flex;
  justify-content: space-between;
}
.btn_delete,
.btn_save {
  width: 300rpx;
  height: 92rpx;
  border-radius: 46rpx;
  text-align: center;
  line-height: 92rpx;
}
.btn_delete {
  color: #5B637C;
  background: #E4EBFA;
}
.btn_save {
  background: #FF5790;
  color: #ffffff;
}
</style>
